import * as NS from "../../../Common/NetServices";
import { IsNull } from "../../../TYLibrary/Common/GlobalExtend";
import { Wx_XSPPage } from "../../../Common/Entitys";
import { Log } from "../../../TYLibrary/System/Logger";
import { Wx_PageData, WXDataClassRuntimeDecorator } from "../../../Common/EntityBase";

@WXDataClassRuntimeDecorator()
class IndexPageData extends Wx_PageData {
    public Item: any = ['1', '2'];
    public indicatorDots: boolean = false;
    public autoplay: boolean = false;
    public interval: number = 5000;
    public duration: number = 1000;
}

class IndexPage extends Wx_XSPPage {
    public Data: IndexPageData = new IndexPageData();

    /**
     * 初始化页面信息
     * @param {any} options
     * @returns {Promise<void>}
     * @memberof IndexPage
     */
    public async InitData(options: any): Promise<void> {
        this.EditTabBar2();

    }

    /**
     * 
     * @param {*} e
     * @returns {void}
     * @memberof IndexPage
     */
    public changeIndicatorDotsHandler(e: any): void {
        this.Data.indicatorDots = !this.Data.indicatorDots;
        this.Data.ApplyChange(this);
    }

    /**
     * 
     * @param {*} e
     * @returns {void}
     * @memberof IndexPage
     */
    public changeAutoplayHandler(e: any): void {
        this.Data.autoplay = !this.Data.autoplay;
        this.Data.ApplyChange(this);
    }

    /**
     * 
     * @param {*} e
     * @returns {void}
     * @memberof IndexPage
     */
    public intervalChangeHandler(e: any): void {
        this.Data.interval = e.detail.value;
        this.Data.ApplyChange(this);
    }

    /**
     * 
     * @param {*} e
     * @returns {void}
     * @memberof IndexPage
     */
    public durationChangeHandler(e: any): void {
        this.Data.duration = e.detail.value;
        this.Data.ApplyChange(this);
    }

}

Page(new IndexPage());
